package com.example.tests;

public class ContactData implements Comparable<ContactData>{
public String firstName;
public String lastName;
public String addressFirst;
public String homeTel;
public String mobileTel;
public String workTel;
public String emailFirst;
public String emailSecond;
public String addressSecond;
public String homeSecond;
public String birthDay;
public int birthMonth;
public String birthYear;
public String userGroup;
public ContactData(){
	}
@Override
public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
	return result;
}

@Override
public boolean equals(Object obj) {
	if (this == obj)
		return true;
	if (obj == null)
		return false;
	if (getClass() != obj.getClass())
		return false;
	ContactData other = (ContactData) obj;
	if (lastName == null) {
		if (other.lastName != null)
			return false;
	} else if (!lastName.equals(other.lastName))
		return false;
	return true;
}
@Override
  public int compareTo(ContactData other) {
  return this.lastName.toLowerCase().compareTo(other.lastName.toLowerCase());
  
	}
@Override
public String toString() {
        return "ContactData [firstName=" + firstName + ", lastName=" + lastName
                        + ", address=" + addressFirst + ", homePhone=" + homeTel
                        + ", mobilePhone=" + mobileTel + ", workPhone=" + workTel
                        + ", email=" + emailFirst + ", email2=" + emailSecond + ",  address2=" + addressSecond
                        + ", homePhone2=" + homeSecond + ",birthDay="
                        + birthDay + ", birthMonth=" + birthMonth + ", birthYear="
                        + birthYear + ", group=" + userGroup + "]";
	}
}